package com.joolun.tennis.service.impl;

import java.util.List;
import com.joolun.common.utils.DateUtils;
import com.joolun.tennis.domain.Activity;
import com.joolun.tennis.mapper.ActivityMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.joolun.tennis.service.IActivityService;

/**
 * 专题Service业务层处理
 * 
 * @author www.joolun.com
 * @date 2022-02-24
 */
@Service
public class ActivityServiceImpl implements IActivityService 
{
    @Autowired
    private ActivityMapper activityMapper;

    /**
     * 查询专题
     * 
     * @param id 专题ID
     * @return 专题
     */
    @Override
    public Activity selectActivityById(Long id)
    {
        return activityMapper.selectActivityById(id);
    }

    /**
     * 查询专题列表
     * 
     * @param activity 专题
     * @return 专题
     */
    @Override
    public List<Activity> selectActivityList(Activity activity)
    {
        return activityMapper.selectActivityList(activity);
    }

    /**
     * 新增专题
     * 
     * @param activity 专题
     * @return 结果
     */
    @Override
    public int insertActivity(Activity activity)
    {
        return activityMapper.insertActivity(activity);
    }

    /**
     * 修改专题
     * 
     * @param activity 专题
     * @return 结果
     */
    @Override
    public int updateActivity(Activity activity)
    {
        activity.setUpdateTime(DateUtils.getNowDate());
        return activityMapper.updateActivity(activity);
    }

    /**
     * 批量删除专题
     * 
     * @param ids 需要删除的专题ID
     * @return 结果
     */
    @Override
    public int deleteActivityByIds(Long[] ids)
    {
        return activityMapper.deleteActivityByIds(ids);
    }

    /**
     * 删除专题信息
     * 
     * @param id 专题ID
     * @return 结果
     */
    @Override
    public int deleteActivityById(Long id)
    {
        return activityMapper.deleteActivityById(id);
    }
}
